package com.qijian.maindata.domain;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.qijian.common.annotation.Excel;
import com.qijian.common.core.domain.BaseEntity;
import com.qijian.common.enums.ApprovalDescriptionEnum;
import com.qijian.tool.domain.Storage;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * 生产BOM用料预算单据对象 main_bom_material_pre
 *
 * @author qijian
 * @date 2022-05-17
 */
@EqualsAndHashCode(callSuper = true)
@Data
@ToString
@TableName("main_bom_material_pre")
public class BomMaterialPre extends BaseEntity {
    private static final long serialVersionUID = 1L;

    @TableId
    @JsonSerialize(using = ToStringSerializer.class)
    @ApiModelProperty(value = "ID")
    private Long id;

    @Excel(name = "编码")
    @ApiModelProperty(value = "编码")
    private String code;

    @Excel(name = "BOM")
    @JsonSerialize(using = ToStringSerializer.class)
    @ApiModelProperty(value = "BOM")
    private Long bomId;

    @Excel(name = "BOM名称")
    @ApiModelProperty(value = "BOM名称")
    private String itemName;

    @Excel(name = "开工令")
    @ApiModelProperty(value = "开工令组合")
    private String projectNos;

    @Excel(name = "发行人")
    @JsonSerialize(using = ToStringSerializer.class)
    @ApiModelProperty(value = "发行人")
    private Long issueId;

    @Excel(name = "发行人名称")
    @ApiModelProperty(value = "发行人名称")
    private String issueNickName;

    @Excel(name = "汇总")
    @ApiModelProperty(value = "汇总")
    private BigDecimal summary;

    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "编制时间", width = 30, dateFormat = "yyyy-MM-dd")
    @ApiModelProperty(value = "审核时间")
    private Date workTime;

    @Excel(name = "状态(0-完成，1-编制中，2-编制完成)")
    @ApiModelProperty(value = "状态(0-完成，1-编制中，2-编制完成)")
    private Integer status;

    @Excel(name = "审核者")
    @ApiModelProperty(value = "审核者")
    private String approvalBy;

    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "审核时间", width = 30, dateFormat = "yyyy-MM-dd")
    @ApiModelProperty(value = "审核时间")
    private Date approvalTime;

    @Excel(name = "审核状态")
    @ApiModelProperty(value = "审核状态")
    private ApprovalDescriptionEnum approvalStatus;

    @TableField(exist = false)
    private List<Storage> files;

    @ApiModelProperty(value = "物料明细")
    @TableField(exist = false)
    private List<BomMaterialPreDetail> details;

    @TableField(exist = false)
    private List<BomMaterialProject> projects;
}
